<template>
  <h2>响应式数据的判断</h2>
</template>

<script lang='ts'>
import {
  defineComponent,
  isRef,
  isReactive,
  isReadonly,
  readonly,
  isProxy,
  reactive,
  ref,
} from "vue";

export default defineComponent({
  name: "App",
  setup() {
    console.log(`isRef=>${isRef(ref({}))}`);//true
    console.log(`isRef=>${isRef(reactive({}))}`);//false
    console.log("---------------------------");

    console.log(`isReactive=>${isReactive(reactive({}))}`);//true
    console.log(`isReactive=>${isReactive(ref({}))}`);//false
    console.log("---------------------------");

    console.log(`isReadonly=>${isReadonly(readonly({}))}`);//true
    console.log(`isReadonly=>${isReadonly(ref({}))}`);//false
    console.log("---------------------------");

    console.log(`isProxy=>${isProxy(readonly({}))}`);//true
    console.log(`isProxy=>${isProxy(reactive({}))}`);//true
    console.log(`isProxy=>${isProxy(ref({}))}`);//false
    console.log("---------------------------");
    return {};
  },
});
</script>
